import React, { Component } from 'react';
import { HashRouter as Router, Route, Switch, Link } from "react-router-dom";
import asyncComponent from './AsyncComponent' ;
import './App.less';

const AsyncMainPage = asyncComponent(() => import("./containers/MainPage/MainPage"));
const AsyncTestPage = asyncComponent(() => import("./containers/TestPage/TestPage"));

class App extends Component {
  render() {
    return (
        <Router
            // basename={`haha`}
        >
            <div>
                <ul>
                    <li><Link to={`/`}>MainPage</Link></li>
                    <li><Link to={`/TestPage`}>TestPage</Link></li>
                </ul>
                <Switch>
                    <Route exact path="/" component={AsyncMainPage} />
                    <Route path="/TestPage" component={AsyncTestPage} />
                </Switch>
            </div>
        </Router>
    );
  }
}

export default App;
